<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>JSCODE</title>
<style>
html{
width:100%;
height:100%;
margin:0;
padding:0;
overflow:hidden;
}
body {
margin:0;
padding:0;
width:100%;
height:100%;
overflow:hidden;
font-size:12px;
font-family:"Andale Mono";
}
#main{
padding:10px 0 0 10px;
height:100%;
overflow:auto;
}
#pop_up{
position:absolute;
right:16px;
top:0;
padding:10px;
background:#fff;
overflow:auto;
border:1px solid #000;
}
dd{
margin-left:20px;
}
h2 a{
color:#006A00;
text-decoration:none;
}
h2 a:hover{
text-decoration:underline;
}
h3{
    color:#aaa;
}
.function_head{
    
}
.variable_head{

}
.example_html b{
    color:#0080C0;
}
p.description {
    border-left:3px solid #aaa;
    border-bottom:1px solid #aaa;
    padding-left:10px;
}
.code{
    border:1px solid #ccc;
    margin-top:5px;
    font-size:11px;
    background:#dedede;
    overflow:auto;
}
dl.item {
    margin-bottom:20px;
}
dl.item dt{
    margin-top:50px;
    background:#eee;
    margin-left:10px;
}
dl.item dt a{
    color:#FF7700;
}
dl.item dt b a{
    font-size:13px;
    color:#333;
    text-decoration:none;
}
dl.item dt b a:hover{
    font-size:13px;
    color:#333;
    text-decoration:underline;
}
li{border-bottom:1px dashed #ccc;line-height:25px}
li b{font-weight:normal}
#name_index{
    border-top:3px solid #ccc;
}
.c128{color:#ff0000}.c512{color:#004000}.c32{color:#008080}.c64{color:#949494}.c2{color:#ff0000}.c8{color:#008000}.c1{color:#0080c0}.c4{color:#ff8040}.c256{color:#000000}.c16{color:#800000}</style>
<script>
function view_source (a) {
    var c = a.parentNode.nextSibling;
    if (c.style.display == 'none') {
        c.style.display = 'block';
    } else {
        c.style.display = 'none';
    }
    return false;
}
</script>
</head>
<body>
<div id="main">
<ol><li><b class="c8">﻿</b><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@filename:&nbsp;&nbsp;&nbsp;&nbsp;dollar.js</b></li><li><b class="c32">&nbsp;*&nbsp;@author:&nbsp;&nbsp;&nbsp;&nbsp;baboo&lt;istxwang@gmail.com&gt;</b></li><li><b class="c32">&nbsp;*/</b></li><li>&nbsp;</li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@var&nbsp;number</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;版本号&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;20080320:&nbsp;修改Bug：当$('table[0]&nbsp;tr.Class1')为null时，$('table[0]&nbsp;tr.Class1&nbsp;div')选择出错</b></li><li><b class="c32">&nbsp;*&nbsp;20080321:&nbsp;修改在Firefox下调用Ajax的Post方法而postBody没定义的话，出现401错误</b></li><li><b class="c32">&nbsp;*&nbsp;20080330:&nbsp;修改Browser对象相关属性的定义&nbsp;isMoz=&gt;isGecko,&nbsp;&nbsp;添加_$添加元素接口</b></li><li><b class="c32">&nbsp;*&nbsp;20080407:&nbsp;添加json请求</b></li><li><b class="c32">&nbsp;*&nbsp;20080412:&nbsp;修改$._$方法调用方式及部分Bug</b></li><li><b class="c32">&nbsp;*&nbsp;20080517:&nbsp;添加_$对象对空元素的支持，添加常用的Dom方法到_$.propoty对象上,修改html对单元素的默认操作</b></li><li><b class="c32">&nbsp;*&nbsp;20080530:&nbsp;添加$.Dom的常用方法至_$.prototype中，直接调用</b></li><li><b class="c32">&nbsp;*&nbsp;20080704:&nbsp;$.Dom._class&nbsp;方法正则式修改,以匹配class中的-符号</b></li><li><b class="c32">&nbsp;*&nbsp;20080722:&nbsp;添加$.Dom.bind方法，将$.Dom的方法绑定到_$中，提供_$中第一个元素的直接调用</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c256">$version</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">20080722</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;传入一个可枚举的对象，输出一个组数对象。</b></li><li><b class="c32">&nbsp;*&nbsp;@params:&nbsp;object</b></li><li><b class="c32">&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;foo&nbsp;()&nbsp;{</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;args&nbsp;=&nbsp;$A(arguments);</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(typeof&nbsp;args);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;'array'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;firstArg&nbsp;=&nbsp;args.pop();&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c256">$A</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">o</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@var&nbsp;object&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@see&nbsp;$continue</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@description&nbsp;:&nbsp;&nbsp;用于跳出的异常对象，参见：@see(base,&nbsp;window.$continue,&nbsp;$continue);</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@example</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;collecter&nbsp;=&nbsp;[],&nbsp;count&nbsp;=&nbsp;0;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,2,3,4,5,6,7,8].each&nbsp;(function&nbsp;(value)&nbsp;{</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(value&nbsp;%&nbsp;2&nbsp;==&nbsp;1)&nbsp;throw&nbsp;$continue;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;collecter.push(value);</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(++count&nbsp;==&nbsp;2)&nbsp;throw&nbsp;$break;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(collecter);&nbsp;//&nbsp;collecter&nbsp;=&nbsp;[2,4]</b></li><li><b class="c32">&nbsp;&nbsp;*/</b>&nbsp;</li><li><b class="c1">var</b>&nbsp;<b class="c256">$break</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Object</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@var&nbsp;object</b></li><li><b class="c32">&nbsp;*&nbsp;@see&nbsp;$break</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;跳出当前函数，继续下一次循环的异常对象，例子可参见@see(base,&nbsp;window.$break,&nbsp;$break);</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c256">$continue</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Object</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;传入一个HTML&nbsp;Element，输出一个_$对象.</b></li><li><b class="c32">&nbsp;*&nbsp;@params:&nbsp;html_element</b></li><li><b class="c32">&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id="foo"&gt;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;foo;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//获取相同的东西</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo&nbsp;=&nbsp;$E('foo');&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo&nbsp;=&nbsp;$E(documnet.getElementById('foo'));&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo&nbsp;=&nbsp;$('#foo');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo&nbsp;=&nbsp;$E(foo);&nbsp;//_$对象直接返回</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c256">$E</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">$</b><b class="c16">(</b>&nbsp;<b class="c64">'#'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">e</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c256">_$</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;</li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@var&nbsp;array</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;存储需要将部分属性导出到$作用域下的对象(参见：@see(base,&nbsp;window.$export,&nbsp;$export))。</b></li><li><b class="c32">&nbsp;*(要导出的对象必须设置了EXPORT属性。属性值可以为字符串'all'及数组。'all'表示导出该对象的所有属性。数组则定义需要导出的属性)</b></li><li><b class="c32">&nbsp;*&nbsp;默认导出参见：&nbsp;@see(object,&nbsp;$.Event.EXPORT,&nbsp;$.Event),&nbsp;@see(object,&nbsp;$.Browser.EXPORT,&nbsp;$.Browser),&nbsp;@see(object,&nbsp;$.Effect.Transitions.EXPORT,&nbsp;$.Effect.Transitions);</b></li><li><b class="c32">&nbsp;*&nbsp;例:</b></li><li><b class="c32">&nbsp;*&nbsp;$.Event设置了EXPORT属性，值为['observe',&nbsp;'stopObserving',&nbsp;'Keys'],</b></li><li><b class="c32">&nbsp;*&nbsp;则导出后&nbsp;$.observe，$.stopObserving,&nbsp;$.Keys&nbsp;为&nbsp;$.Event.observe,&nbsp;$.Event.stopObserving,&nbsp;$.Event.Keys的简单引用</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c256">$EXPORT</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c64">'Event'</b><b class="c16">,</b>&nbsp;<b class="c64">'Browser'</b><b class="c16">,</b>&nbsp;<b class="c64">'Effect.Transitions'</b><b class="c8">]</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description&nbsp;:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将对象属性导入到$作用域下(如果$作用域下已存在同名的属性，则不能覆盖。</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认导出由@see(base,&nbsp;window.$EXPORT,&nbsp;$EXPORT)变量中定义的对象。如果传递了参数则导出参数中定义的对象。</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;自定义导入需要传入参数，参数为$作用域下的一个对象名的字符串(名称路径中不包含$)，例：Builder,&nbsp;Effect.Transtions...</b></li><li><b class="c32">&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//将$.Builder.node方法导出至$下</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.Builder.EXPORT&nbsp;=&nbsp;'node';&nbsp;//&nbsp;or&nbsp;$.Builder.EXPORT&nbsp;=&nbsp;['node']</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$export('Builder');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.node('&lt;div&gt;hello,world&lt;/div&gt;');&nbsp;//现在可以直接使用$.node来代替$.Builder.node</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">function</b>&nbsp;<b class="c256">$export</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">toExport</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c4">arguments</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c256">$EXPORT</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">toExport</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ns</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">toExport</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'.'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c16">,</b>&nbsp;<b class="c256">findO</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">true</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">ns</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">ns</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">findO</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">findO</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b><b class="c16">)</b>&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b><b class="c8">.</b><b class="c4">toLowerCase</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'all'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">pro</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'EXPORT'</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">!</b>&nbsp;<b class="c16">(</b><b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c8">$</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c16">(</b><b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c8">$</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isArray</b><b class="c16">(</b><b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8"><</b><b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">EXPORT</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">npro</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c512">/^(.+)=>(.+)$/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">pro</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">pro</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">npro</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$2</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">npro</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b>&nbsp;<b class="c16">(</b><b class="c256">npro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c8">$</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isFunction</b><b class="c16">(</b><b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">[</b><b class="c256">npro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">[</b><b class="c256">npro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;该函数根据参数个数及类型的不同，执行不同的动作。</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;1,&nbsp;不传入参数或传入一个普通对象（{}),则返回一个函数，其中对象中定义的是该函数的prototype属性。初始化函数为__init;</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2,&nbsp;传入一个普通对象，且其中定义了timespan属性及callback属性时，则将该对象添加到定时器中.</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;3,&nbsp;传入的第一个参数是string时，如果该string符合下列规则</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.1&nbsp;一段HTML元素代码e.g.&nbsp;&lt;div&nbsp;class="class1"&gt;content&lt;/div&gt;，则返回生成的html_element对象</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.2&nbsp;是一个url（以http开头或有前缀url:),则生成一个$.Ajax.Simple对象，如果存在参数2的话，其被参数$.Ajax.Simple构造函数中</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.3&nbsp;元素选择描述字符串e.g.&nbsp;&nbsp;"#id1&nbsp;div.class1",&nbsp;"div&nbsp;.class2&nbsp;&gt;span[title=something]"...,&nbsp;返回一个_$对象</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;4,&nbsp;传入的第一个参数是一个event对象，根据第二个参数att进行如下过程：</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.1&nbsp;$.Event.Methods中的存在名字为att的方法，调用该函数，并将相关参数代入。返回结果</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.2&nbsp;返回event&nbsp;的属性att</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;5,&nbsp;传入的第一个参数是一个html_element对象，返回一个_$对象</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;6,&nbsp;传入的第一个参数是一个function,&nbsp;将该function绑定到window.onload事件上</b></li><li><b class="c32">&nbsp;*&nbsp;@example</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="c1"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//node1</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;class="c1&nbsp;c2"&nbsp;href="http://www.baboo.com"&nbsp;rel="wan"&gt;Baboo&nbsp;Home&lt;/a&gt;&nbsp;//node2</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;class="c1&nbsp;c3"&nbsp;href="http://www.baidu.com"&gt;百度&lt;/a&gt;&nbsp;//node3</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;class="c1&nbsp;c4"&nbsp;href="http://www.google.com"&nbsp;rel="on"&gt;Google&lt;/a&gt;&nbsp;//node4</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;class="c2&nbsp;c4"&nbsp;href="http://www.pp.tv"&nbsp;rel="off"&gt;PP.tv&lt;/a&gt;&nbsp;//node5</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id="p"&gt;&nbsp;&nbsp;&nbsp;&nbsp;//node6</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h&gt;title&lt;/h&gt;&nbsp;&nbsp;&nbsp;&nbsp;//node7</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="c5"&gt;&nbsp;&nbsp;&nbsp;&nbsp;//node8</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="c6"&gt;happy&lt;/div&gt;&nbsp;&nbsp;&nbsp;&nbsp;//node9</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="c6"&gt;angry&lt;/div&gt;&nbsp;&nbsp;&nbsp;&nbsp;//node&nbsp;10</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//元素选取</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#p');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//id=p的元素&nbsp;[node6]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('*.c1');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//包含类样式c1的任意元素&nbsp;[node1,&nbsp;node2,&nbsp;node3,&nbsp;node4]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('div');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//所有DIV元素&nbsp;[node1,&nbsp;node&nbsp;6,&nbsp;node8,&nbsp;node9,&nbsp;node10]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#p&nbsp;;&nbsp;*.c1');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//id=p的元素和包含样式c1的任意元素&nbsp;[node6,&nbsp;node1,&nbsp;node2,&nbsp;node3,&nbsp;node4]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[rel=wan]');&nbsp;&nbsp;&nbsp;&nbsp;//包含属性且值等于wan的元素&nbsp;[node2]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[@rel]');&nbsp;&nbsp;&nbsp;&nbsp;//包含属性rel的A元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[rel&nbsp;^=&nbsp;w]');&nbsp;&nbsp;&nbsp;&nbsp;//包含属性rel且值以w开始的A元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[rel&nbsp;$=&nbsp;n]');&nbsp;&nbsp;&nbsp;&nbsp;//包含属性rel且值以n结尾的A元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[0]');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//[node2]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[1..2]');&nbsp;&nbsp;&nbsp;&nbsp;//[node3,&nbsp;node4]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[2..:last]');&nbsp;&nbsp;&nbsp;&nbsp;//[node4,&nbsp;node5]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[2..:last-1]')&nbsp;&nbsp;&nbsp;&nbsp;//[node4]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[:first..2]');&nbsp;&nbsp;&nbsp;&nbsp;//[node2,&nbsp;node3,&nbsp;node4]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a[:last]');&nbsp;&nbsp;&nbsp;&nbsp;//[node5]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#p&nbsp;&gt;div');&nbsp;&nbsp;&nbsp;&nbsp;//id=p的元素的&nbsp;所有子DIV元素&nbsp;[node8,&nbsp;node10]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#p&nbsp;div.c5&nbsp;*.c6');&nbsp;&nbsp;&nbsp;&nbsp;//[node9]</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('a',&nbsp;e);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//e元素包含的所有A元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//元素创建</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('&lt;div&nbsp;class="c1"&nbsp;style="color:red"&gt;&lt;h&gt;Hello&lt;/h&gt;&lt;/div&gt;');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//返回一个DIV元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//类创建</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;class&nbsp;=&nbsp;$({</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;__init&nbsp;:&nbsp;function&nbsp;()&nbsp;{&nbsp;alert('inited')&nbsp;},</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fun&nbsp;:&nbsp;function&nbsp;()&nbsp;{alert('fun')}</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;instance&nbsp;=&nbsp;new&nbsp;class();&nbsp;//alert('inited');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance.fun();&nbsp;&nbsp;&nbsp;&nbsp;//alert('fun');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//事件函数调用</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(event,&nbsp;'x');&nbsp;&nbsp;&nbsp;&nbsp;//返回事件发生的页面x座标</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//domready事件绑定</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(function(){</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert('domready!');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//定时调用</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$({</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timespan:&nbsp;&nbsp;2,&nbsp;//2秒后调用callback函数</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback&nbsp;:&nbsp;function&nbsp;()&nbsp;{alert('called')}</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//loop&nbsp;:&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;//只调用一次还是循环调用</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Ajax</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('http://www.baboo.com/ajax.php',&nbsp;function(http)&nbsp;{alert(http.responseText)});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('get:a.php',&nbsp;function&nbsp;(http)&nbsp;{});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('json:b.js',&nbsp;function(json)&nbsp;{});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//为一个Dom&nbsp;element创建一个_$对象</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(document.getElementById('foo'));</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c8">$</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">isObject</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c1">true</b><b class="c16">)</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c256">timespan</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c256">callback</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Timer</b><b class="c8">.</b><b class="c256">add</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">isObject</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c1">true</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_class</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">__init</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c1">this</b><b class="c16">,</b>&nbsp;<b class="c4">arguments</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">_class</b><b class="c8">.</b><b class="c4">prototype</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">_class</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">switch</b>&nbsp;<b class="c16">(</b><b class="c1">true</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/*Builder&nbsp;Node*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c512">/^<(.|\n)+>$/</b><b class="c16">)</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Builder</b><b class="c8">.</b><b class="c256">node</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/*ajax*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c512">/^(url|http)/i</b><b class="c16">)</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">[</b><b class="c64">'callback'</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">dataQuery</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^url:/i</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">new</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">Simple</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^url:/i</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c512">/^(get|post|json)/i</b><b class="c16">)</b><b class="c8">:</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">t_method</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">t_method</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'json'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">new</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Json</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^(json):/i</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">new</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">Simple</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^(get|post):/i</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c16">{</b><b class="c4">method</b><b class="c8">:</b>&nbsp;&nbsp;<b class="c256">t_method</b><b class="c16">,</b>&nbsp;<b class="c256">onSuccess</b><b class="c8">:</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">postBody</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/*Select&nbsp;Dom&nbsp;Nodes*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">default</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">es</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">';'</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">_es</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">es</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">getElements</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c256">trim</b><b class="c16">(</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">ret</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_es</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">_es</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">ret</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c256">_$</b><b class="c16">(</b><b class="c256">_es</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isObject</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isEvent</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">Methods</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">Methods</b><b class="c8">[</b><b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">]</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">[</b><b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c256">_$</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isFunction</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isReady</b><b class="c16">)</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c8">$</b><b class="c8">.</b><b class="c256">ReadyList</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">ReadyList</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">ReadyList</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;空函数，什么也不做，一般用作为缺省的函数参数</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;辅助函数，传入什么，返回什么</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">K</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">k</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">k</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c1">var</b>&nbsp;<b class="c256">$gidbase</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;生成一个全局内惟一的字符串</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">gid</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c64">'GID'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c16">(</b><b class="c256">$gidbase</b><b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@var&nbsp;array</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;事件类型</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">events</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c64">'abort'</b><b class="c16">,</b>&nbsp;<b class="c64">'blur'</b><b class="c16">,</b>&nbsp;<b class="c64">'change'</b><b class="c16">,</b>&nbsp;<b class="c64">'click'</b><b class="c16">,</b>&nbsp;<b class="c64">'dblclick'</b><b class="c16">,</b>&nbsp;<b class="c64">'error'</b><b class="c16">,</b>&nbsp;<b class="c64">'focus'</b><b class="c16">,</b>&nbsp;<b class="c64">'keydown'</b><b class="c16">,</b>&nbsp;<b class="c64">'keyup'</b><b class="c16">,</b>&nbsp;<b class="c64">'load'</b><b class="c16">,</b>&nbsp;<b class="c64">'mousedown'</b><b class="c16">,</b>&nbsp;<b class="c64">'mousemove'</b><b class="c16">,</b>&nbsp;<b class="c64">'mouseout'</b><b class="c16">,</b>&nbsp;<b class="c64">'mouseover'</b><b class="c16">,</b>&nbsp;<b class="c64">'mouseup'</b><b class="c16">,</b>&nbsp;<b class="c64">'reset'</b><b class="c16">,</b>&nbsp;<b class="c64">'resize'</b><b class="c16">,</b>&nbsp;<b class="c64">'scroll'</b><b class="c16">,</b>&nbsp;<b class="c64">'select'</b><b class="c16">,</b>&nbsp;<b class="c64">'submit'</b><b class="c16">,</b>&nbsp;<b class="c64">'unload'</b><b class="c8">]</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个数组</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isArray</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">constructor</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c2">Array</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个对象，如果设置了flag为真的话，则判断该变量是一个{}类型的对象。</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isObject</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c256">flag</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">flag</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c8">.</b><b class="c256">constructor</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c2">Object</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">!</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isEvent</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">!</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c4">typeof</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'object'</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个字符串对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">constructor</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c2">String</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个数值对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isNumber</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">constructor</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c2">Number</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个数值对象或字符串对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isStringOrNumber</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">[</b><b class="c64">'string'</b><b class="c16">,</b>&nbsp;<b class="c64">'number'</b><b class="c8">]</b><b class="c8">.</b><b class="c256">include</b><b class="c16">(</b><b class="c4">typeof</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个函数</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isFunction</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c4">typeof</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'function'</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个事件对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isEvent</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">!</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c4">type</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">events</b><b class="c8">.</b><b class="c256">include</b><b class="c16">(</b><b class="c256">o</b><b class="c8">.</b><b class="c4">type</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断变量是否是一个html&nbsp;element对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c256">nodeType</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;判断模块要求的库版本是否符合要求</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">require</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c8">/</b><b class="c8">^</b><b class="c16">(</b><b class="c8">\</b><b class="c8">$</b><b class="c8">|</b><b class="c8">\</b><b class="c256">w</b><b class="c8">+</b><b class="c16">)</b><b class="c8">\</b><b class="c256">s</b><b class="c8">+</b><b class="c16">(</b><b class="c8">\</b><b class="c256">d</b><b class="c8">+</b><b class="c16">)</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c4">arguments</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">throw</b>&nbsp;<b class="c64">"invalid&nbsp;argument&nbsp;"</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">"&nbsp;for&nbsp;$.require!"</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">v</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'$'</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">$version</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">[</b><b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c8">]</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">[</b><b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c8">]</b><b class="c8">.</b><b class="c256">version</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c128">0</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">rv</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">parseInt</b><b class="c16">(</b><b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$2</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">rv</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c256">v</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">throw</b>&nbsp;<b class="c8">[</b><b class="c64">'Version&nbsp;too&nbsp;low:$.'</b><b class="c16">,</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c64">''</b><b class="c16">,</b>&nbsp;<b class="c64">'&nbsp;require&nbsp;'</b><b class="c16">,</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'$'</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c64">'dollar'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c16">(</b><b class="c64">'$.'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$2</b><b class="c16">)</b><b class="c16">,</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c64">'&nbsp;version&nbsp;'</b><b class="c16">,</b>&nbsp;<b class="c256">rv</b><b class="c16">,</b>&nbsp;<b class="c64">',&nbsp;but&nbsp;version&nbsp;is&nbsp;'</b><b class="c16">,</b>&nbsp;<b class="c256">v</b><b class="c8">]</b><b class="c8">.</b><b class="c4">join</b><b class="c16">(</b><b class="c64">''</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@var&nbsp;string</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;全局的错误信息存放变量&nbsp;</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">error</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">''</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;节点选择方法，传入路径参数，一般通过@see(base,&nbsp;window.$,&nbsp;$)的Dom元素选取方法间接调用</b></li><li><b class="c32">&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id="main"&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;class="c1"&gt;&lt;b&gt;h&lt;/b&gt;&lt;i&gt;o&lt;/i&gt;&lt;b&gt;w&lt;/b&gt;&lt;/span&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="c1&nbsp;c2"&gt;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="text"&nbsp;value="c"/&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;rel="my&nbsp;rel"&nbsp;name="checkbox_group"&nbsp;type="checkbox"&nbsp;value="check1"&nbsp;checked/&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;rel="thx"&nbsp;&nbsp;name="checkbox_group"&nbsp;type="checkbox"&nbsp;value="check2"/&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;&nbsp;name="checkbox_group"&nbsp;type="checkbox"&nbsp;value="check3"/&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;select&nbsp;name="sel"&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value="1"&gt;1&lt;/option&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value="2"/&gt;2&lt;/opiton&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value="3"/&gt;3&lt;/option&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/sel&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#main');&nbsp;//获取ID值等于main的元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('*');&nbsp;//获取所有元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input');&nbsp;//获取所有tagName&nbsp;==&nbsp;'input'的元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[1]');&nbsp;//获取所有tagName&nbsp;==&nbsp;'input'的元素中的第2个</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[:last]');&nbsp;//获取所有tagName&nbsp;==&nbsp;'input'的元素中的最后一个(注：:last最后一个索引位置的名称，:first第一个索引位置的名称</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[0..2]');&nbsp;//获取所有tagName&nbsp;==&nbsp;'input'的元素中的第1~3个</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text]');&nbsp;//获取所有type=text的input元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('select&nbsp;option[selected=true]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=checkbox][checked=true]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[@rel]');&nbsp;//获取拥有属性rel的input元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[rel=thx]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[rel^=my]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[rel$=rel]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('input[rel*=e]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('*.c1');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('*.c1.c2');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#main&nbsp;&gt;div');&nbsp;//获取id为main的元素下的子节点中tagName==div的元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//总结：</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//ID选择&nbsp;$('#main');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//tagName选择&nbsp;$('a');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//类选择&nbsp;$('a.class1');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//子节点选择$('a&nbsp;&gt;b.class2');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//范围选择&nbsp;$('span[0..2]'),&nbsp;$('span[0..:last-1]'),&nbsp;$('span&nbsp;a[1]');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//属性选择&nbsp;$('a[href*=baidu]'),&nbsp;$('a[@rel]'),&nbsp;...</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">getElements</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_atts</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_attCollect</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">a</b><b class="c16">,</b>&nbsp;<b class="c256">b</b><b class="c16">,</b>&nbsp;<b class="c256">c</b><b class="c16">,</b>&nbsp;<b class="c256">d</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">att</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c64">'className='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">c</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">b</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">_atts</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">att</b><b class="c16">)</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c128">1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c64">'['</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">']'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">getElementsByAttribute</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">es</b><b class="c16">,</b>&nbsp;<b class="c256">attsStr</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">atts</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">attsStr</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">']['</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">atts</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">attPart</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">_atts</b><b class="c8">[</b><b class="c256">atts</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">switch</b>&nbsp;<b class="c16">(</b><b class="c1">true</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c8">[</b><b class="c8">\</b><b class="c256">d</b><b class="c8">\</b><b class="c256">s</b><b class="c16">,</b><b class="c8">]</b><b class="c8">+</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">attPart</b><b class="c16">)</b><b class="c8">:</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ma</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">attPart</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">','</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">ma</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">parseInt</b><b class="c16">(</b><b class="c256">ma</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">es</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c4">index</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c8">:</b><b class="c16">(</b><b class="c8">\</b><b class="c256">w</b><b class="c8">+</b><b class="c16">)</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">attPart</b><b class="c16">)</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">switch</b><b class="c16">(</b><b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c8">.</b><b class="c4">toLowerCase</b><b class="c16">(</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'first'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">es</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'last'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">es</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">.</b><b class="c256">last</b><b class="c16">(</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c1">break</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c16">(</b><b class="c16">(</b><b class="c8">?</b><b class="c8">:</b><b class="c8">:</b><b class="c256">first</b><b class="c8">|</b><b class="c8">\</b><b class="c256">d</b><b class="c8">+</b><b class="c16">)</b><b class="c16">)</b><b class="c8">\</b><b class="c8">.</b><b class="c8">\</b><b class="c8">.</b><b class="c16">(</b><b class="c16">(</b><b class="c8">?</b><b class="c8">:</b><b class="c8">:</b><b class="c256">last</b><b class="c8">|</b><b class="c8">\</b><b class="c256">d</b><b class="c8">+</b><b class="c16">)</b><b class="c16">(</b><b class="c8">?</b><b class="c8">:</b><b class="c8">\</b><b class="c256">s</b><b class="c8">*</b><b class="c8">-</b><b class="c8">\</b><b class="c256">s</b><b class="c8">*</b><b class="c8">\</b><b class="c256">d</b><b class="c8">+</b><b class="c16">)</b><b class="c8">?</b><b class="c16">)</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">attPart</b><b class="c16">)</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">parts</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">attPart</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'..'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">start</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">parts</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">':first'</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c4">parseInt</b><b class="c16">(</b><b class="c256">parts</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c128">10</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">end</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">eval</b><b class="c16">(</b><b class="c256">parts</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/:last/</b><b class="c16">,</b>&nbsp;<b class="c256">es</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c128">1</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">start</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b><b class="c8">=</b>&nbsp;<b class="c256">end</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">es</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b><b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c16">(</b><b class="c8">\</b><b class="c256">w</b><b class="c8">+</b><b class="c16">)</b><b class="c8">\</b><b class="c256">s</b><b class="c8">*</b><b class="c16">(</b><b class="c8">\</b><b class="c8">!</b><b class="c8">|</b><b class="c8">\</b><b class="c8">^</b><b class="c8">|</b><b class="c8">\</b><b class="c8">$</b><b class="c8">|</b><b class="c8">\</b><b class="c8">*</b><b class="c16">)</b><b class="c8">?</b><b class="c8">=</b><b class="c8">\</b><b class="c256">s</b><b class="c8">*</b><b class="c16">(</b><b class="c8">.</b><b class="c8">+</b><b class="c16">)</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">attPart</b><b class="c16">)</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">att</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c16">,</b>&nbsp;<b class="c256">etype</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$2</b><b class="c16">,</b>&nbsp;<b class="c256">vl</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$3</b><b class="c16">,</b>&nbsp;<b class="c256">testBool</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">es</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">att</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'className'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">testBool</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">className</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c8">new</b>&nbsp;<b class="c2">RegExp</b><b class="c16">(</b>&nbsp;<b class="c64">'(^|\\s+)'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">vl</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'(\\s+|$)'</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">testBool</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">attVal</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c4">getAttribute</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">att</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">true</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">attVal</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">null</b><b class="c16">)</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c256">attVal</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">String</b><b class="c16">(</b><b class="c256">attVal</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">switch</b>&nbsp;<b class="c16">(</b><b class="c256">etype</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'!'</b>&nbsp;<b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">testBool</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">attVal</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">vl</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'^'</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">testBool</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">attVal</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c256">vl</b><b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'$'</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">testBool</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">attVal</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c256">vl</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">vl</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">attVal</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'*'</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">testBool</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">attVal</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c256">vl</b><b class="c16">)</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">default</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">testBool</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">hasAtt</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">attVal</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">vl</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">testBool</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c8">@</b><b class="c16">(</b><b class="c8">\</b><b class="c256">w</b><b class="c8">+</b><b class="c16">)</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">attPart</b><b class="c16">)</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">attName</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">RegExp</b><b class="c8">.</b><b class="c256">$1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">es</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c4">getAttribute</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">attName</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">es</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">j</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">atts</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">es</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">path</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ps</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">path</b><b class="c8">.</b><b class="c256">trim</b><b class="c16">(</b><b class="c16">)</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/\[([^\]]+)\]/g</b><b class="c16">,</b>&nbsp;<b class="c256">_attCollect</b><b class="c16">)</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/(\.)([\w-]+)/g</b><b class="c16">,</b>&nbsp;<b class="c256">_attCollect</b><b class="c16">)</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'&nbsp;'</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">stack1</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">stack2</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">ps</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">ps</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">''</b><b class="c16">)</b>&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">p</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ps</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ma</b>&nbsp;<b class="c8">=</b>&nbsp;&nbsp;<b class="c256">p</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c512">/^([#>]?)([\w-]+|\*)(?:\[(.+)\])?$/</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">ma</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">error</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'wrong&nbsp;format:'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">path</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_atts</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">stack1</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">i</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stack1</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c4">arguments</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">document</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">switch</b>&nbsp;<b class="c16">(</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">''</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">stack1</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">temp</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c256">stack1</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c8">.</b><b class="c256">getElementsByTagName</b><b class="c16">(</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">temp</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">stack2</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">temp</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'#'</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c256">stack1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stack1</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">getElementById</b><b class="c16">(</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stack2</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">[</b><b class="c256">e</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'&gt;'</b><b class="c8">:</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">tag</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c8">.</b><b class="c4">toUpperCase</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">stack1</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">children</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">stack1</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c8">.</b><b class="c256">childNodes</b><b class="c16">,</b>&nbsp;<b class="c256">temp</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">k</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">k</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c4">children</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">k</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c4">children</b><b class="c8">[</b><b class="c256">k</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c4">children</b><b class="c8">[</b><b class="c256">k</b><b class="c8">]</b><b class="c8">.</b><b class="c256">nodeName</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">tag</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c256">tag</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'*'</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">temp</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c4">children</b><b class="c8">[</b><b class="c256">k</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">temp</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">stack2</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">temp</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">stack2</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">_atts</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c256">stack1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stack1</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">stack2</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stack1</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">stack1</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">3</b><b class="c8">]</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">getElementsByAttribute</b><b class="c16">(</b><b class="c256">stack2</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">3</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">stack2</b><b class="c8">[</b><b class="c256">j</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c256">stack2</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stack2</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_atts</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">stack1</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c16">}</b>&nbsp;<b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">getElementsByClassName</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">className</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_elementsWithClass</b><b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">document</b><b class="c16">,</b>&nbsp;<b class="c4">className</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@var</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;@see(base,&nbsp;$.getAttribute,&nbsp;$.getAttribute)</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">props</b>&nbsp;&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c64">"for"</b><b class="c8">:</b>&nbsp;<b class="c64">"htmlFor"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c64">"class"</b><b class="c8">:</b>&nbsp;<b class="c64">"className"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">value</b><b class="c8">:</b>&nbsp;<b class="c64">"value"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">disabled</b><b class="c8">:</b>&nbsp;<b class="c64">"disabled"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">checked</b><b class="c8">:</b>&nbsp;<b class="c64">"checked"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">readonly</b><b class="c8">:</b>&nbsp;<b class="c64">"readOnly"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">selected</b><b class="c8">:</b>&nbsp;<b class="c64">"selected"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">maxlength</b><b class="c8">:</b>&nbsp;<b class="c64">"maxLength"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">selectedIndex</b><b class="c8">:</b>&nbsp;<b class="c64">"selectedIndex"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">defaultValue</b><b class="c8">:</b>&nbsp;<b class="c64">"defaultValue"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">tagName</b><b class="c8">:</b>&nbsp;<b class="c64">"tagName"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">nodeName</b><b class="c8">:</b>&nbsp;<b class="c64">"nodeName"</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">childNodes</b><b class="c8">:</b>&nbsp;<b class="c64">'childNodes'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">offsetWidth</b><b class="c8">:</b>&nbsp;<b class="c64">'offsetWidth'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">offsetHeight</b><b class="c8">:</b>&nbsp;<b class="c64">'offsetHeight'</b></li><li><b class="c16">}</b><b class="c16">;</b>&nbsp;</li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;获取一个Dom&nbsp;Element的属性，参见：@see(base,&nbsp;$.setAttribute,&nbsp;$.setAttribute);</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c4">getAttribute</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">props</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">props</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">props</b><b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b><b class="c8">[</b><b class="c256">props</b><b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Browser</b><b class="c8">.</b><b class="c256">IE</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">/</b><b class="c4">src</b><b class="c8">|</b><b class="c4">href</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c4">name</b><b class="c8">.</b><b class="c4">toLowerCase</b><b class="c16">(</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b>&nbsp;&nbsp;<b class="c1">return</b>&nbsp;&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">getAttribute</b>&nbsp;<b class="c16">(</b><b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c128">2</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c4">tagName</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'SELECT'</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'value'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">options</b><b class="c8">[</b><b class="c256">e</b><b class="c8">.</b><b class="c4">selectedIndex</b><b class="c8">]</b><b class="c8">.</b><b class="c4">value</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c256">attributes</b><b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">attributes</b>&nbsp;<b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c8">.</b><b class="c256">nodeValue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">getAttribute</b><b class="c16">(</b><b class="c4">name</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b>&nbsp;</li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;设置一个Dom&nbsp;Element的属性，参见：@see(base,&nbsp;$.getAttribute,&nbsp;$.getAttribute);</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c4">setAttribute</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c4">value</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">props</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">props</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">props</b><b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">e</b><b class="c8">[</b><b class="c256">props</b><b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">value</b><b class="c16">;</b>&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c4">tagName</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'SELECT'</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'value'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">options</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c4">options</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">value</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">value</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c256">e</b><b class="c8">.</b><b class="c4">selectedIndex</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">i</b><b class="c16">;</b>&nbsp;<b class="c1">break</b><b class="c16">;</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c256">attributes</b>&nbsp;<b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">attributes</b><b class="c8">[</b><b class="c4">name</b><b class="c8">]</b><b class="c8">.</b><b class="c256">nodeValue</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">value</b><b class="c16">;</b>&nbsp;<b class="c1">return</b><b class="c16">;</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">setAttribute</b>&nbsp;<b class="c16">(</b><b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c64">""</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">value</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@class&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;Dom元素操作封装，实例化：e.g.&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;_$(element1);&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;_$(element1,&nbsp;element2,&nbsp;...)</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;_$([element1,&nbsp;element2,&nbsp;..]);</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;通常你不需要直接生成该对象，可通过@see(base,&nbsp;window.$E,&nbsp;$E)及@see(base,&nbsp;window.$,&nbsp;$)函数生成</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c1">var</b>&nbsp;<b class="c256">_$</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c16">{</b></li><li><b class="c256">__init</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c4">arguments</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">e</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">_$</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">true</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b><b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b><b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">,</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;$(elementIndex,&nbsp;attributeName,&nbsp;valueToSetOrLeaveItUndefinedToGetTheAttributeValue)</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;$(attributeName,&nbsp;valueToSetOrLeaveItUndefinedToGetTheAttributeValue)</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;$(elementIndex,&nbsp;$domMethodName,&nbsp;params)</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;$(elementIndex,&nbsp;$$domMethodName,&nbsp;params)</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;$($domMethodName,&nbsp;params)</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;$($$domMethodName,&nbsp;params)&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domMethodName&nbsp;:&nbsp;如果定义了$.Dom['_'&nbsp;+&nbsp;domMethodName]则调用，否则调用元素的domMethodName&nbsp;方法，前缀$表示是调用方法，$$&nbsp;表示要求返回值&nbsp;示</b></li><li><b class="c32">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;如果有返回值的话，个数为1则直接返回，否则返回一个数组</b></li><li><b class="c32">&nbsp;*&nbsp;@example</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id="foo"&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;class="c1"&gt;hello&lt;/span&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;class="c2"&gt;world&lt;/span&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="text"&nbsp;myrel="see"&nbsp;value="so"/&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type="text"&nbsp;value="soso"/&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;select&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value="1"&nbsp;selected&gt;1&lt;/option&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value="2"&gt;2&lt;/option&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option&nbsp;value="3"&gt;3&lt;/option&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/select&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/html&gt;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text]')[0].value;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//直接通过Dom&nbsp;Element获取&nbsp;'so'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text]').$(1,&nbsp;'value');&nbsp;&nbsp;&nbsp;&nbsp;//通过$方法获取第2个元素的value属性&nbsp;'soso'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text]').$('value');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//获取所有元素的value属性['so',&nbsp;'soso']</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text][0]').$('value');&nbsp;&nbsp;&nbsp;&nbsp;//如果_$只包含一个元素，则不以数组的形式返回'so'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text][@rel]').$('myrel');&nbsp;&nbsp;&nbsp;&nbsp;//'see'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text]')[0].value&nbsp;=&nbsp;'change';</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('input[type=text]').$(0,&nbsp;'value',&nbsp;'change');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('span.c1').$('$class',&nbsp;'+c2').$('class');&nbsp;&nbsp;&nbsp;&nbsp;//调用$.Dom._class方法,&nbsp;添加新的类样式c2，并返回元素的class属性</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('select[0]').$('value');&nbsp;//获取select的选中值</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;$('select[0]').$('value',&nbsp;2);&nbsp;//设置select的选中项</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;alert($('span.c1').$('$class',&nbsp;'+c2').$$('$class',&nbsp;'c2'));&nbsp;&nbsp;&nbsp;&nbsp;//true</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">,</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isNumber</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ma</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c512">/^(\$?)(\$?)(.+)$/</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">isMethod</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">!</b><b class="c8">!</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">wantRetVal</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">!</b><b class="c8">!</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">methodOrAttrName</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">3</b><b class="c8">]</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">wantRetVal</b>&nbsp;&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">undefined</b>&nbsp;&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">isMethod</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c64">'_'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">methodOrAttrName</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">method</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'_'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">methodOrAttrName</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">false</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">index</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">[</b><b class="c4">method</b><b class="c8">]</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c1">null</b><b class="c16">,</b>&nbsp;<b class="c8">[</b><b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">args</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">[</b><b class="c4">method</b><b class="c8">]</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c1">null</b><b class="c16">,</b>&nbsp;<b class="c8">[</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">args</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">wantRetVal</b>&nbsp;&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">false</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">index</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c8">[</b><b class="c256">methodOrAttrName</b><b class="c8">]</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">[</b><b class="c256">methodOrAttrName</b><b class="c8">]</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">wantRetVal</b>&nbsp;&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">//set&nbsp;or&nbsp;get&nbsp;attribute</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">false</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">index</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c4">setAttribute</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">methodOrAttrName</b>&nbsp;<b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c4">setAttribute</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">methodOrAttrName</b>&nbsp;<b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">false</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">index</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c4">getAttribute</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">methodOrAttrName</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c4">getAttribute</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">methodOrAttrName</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;css(elementIndex,&nbsp;styleNameWantToGet)</b></li><li><b class="c32">&nbsp;*&nbsp;css(elementIndex,&nbsp;styleStringOrStyleObjectWantToSet)</b></li><li><b class="c32">&nbsp;*&nbsp;css(styleNameWantToGet)</b></li><li><b class="c32">&nbsp;*&nbsp;css(styleStringOrStyleObjectWantToSet)</b></li><li><b class="c32">&nbsp;*&nbsp;如果有返回值，&nbsp;个数为1则直接返回，否则返回数组</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c256">css</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isNumber</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">!</b>&nbsp;<b class="c8">/</b><b class="c8">:</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">index</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_style</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_style</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">styles</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">styles</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/;$/</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ts</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">';'</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">i</b><b class="c16">,</b>&nbsp;<b class="c256">t</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">ts</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ts</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">':'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">styles</b><b class="c8">[</b><b class="c256">t</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c256">trim</b><b class="c16">(</b><b class="c16">)</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">t</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c256">trim</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">styles</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">index</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_style</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">styles</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_style</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">styles</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;遍历所有元素</b></li><li><b class="c32">&nbsp;*&nbsp;@params:&nbsp;function(element)</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c256">each</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">f</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">f</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">i</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">$continue</b><b class="c16">)</b>&nbsp;<b class="c1">throw</b>&nbsp;<b class="c256">e</b><b class="c16">;</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">$break</b><b class="c16">)</b>&nbsp;<b class="c1">throw</b>&nbsp;<b class="c256">e</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;以当前的元素为根，查找相关元素，参数为元素选择串，返回@see(class,&nbsp;_$,&nbsp;_$)对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c4">find</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c4">arguments</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;html(elementIndex)</b></li><li><b class="c32">&nbsp;*&nbsp;html(elementIndex,&nbsp;htmlStringWantToSet)</b></li><li><b class="c32">&nbsp;*&nbsp;html()</b></li><li><b class="c32">&nbsp;*&nbsp;html(htmlStringWantToSet)</b></li><li><b class="c32">&nbsp;*&nbsp;如果有返回值，&nbsp;个数为1则直接返回，否则返回数组</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c256">html</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isNumber</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c4">index</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">index</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">index</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">args</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">index</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c4">index</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;返回第i个html&nbsp;element</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c256">item</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">i</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;调用一个Ajax请求，并将请求结果字符写入该元素中</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c256">fill</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">sets</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">sets</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">preCall</b><b class="c16">)</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">preCall</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c64">'url:'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">method</b><b class="c8">:</b>&nbsp;<b class="c64">'get'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">onSuccess</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">t</b><b class="c16">,</b>&nbsp;<b class="c256">json</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">_t</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">_t</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">process</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">process</b><b class="c16">(</b><b class="c256">t</b><b class="c8">.</b><b class="c256">responseText</b><b class="c16">,</b>&nbsp;<b class="c256">json</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">responseText</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">sufCall</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c256">_t</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">onFailure</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">_t</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c256">_t</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c4">innerHTML</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">failedText</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c64">'Fail&nbsp;to&nbsp;Load&nbsp;data'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">sufCall</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c256">_t</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;添加元素&nbsp;</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c256">add</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">args</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c256">thie</b><b class="c8">.</b><b class="c256">e</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">,</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;取消元素绑定的所有事件</b></li><li><b class="c32">&nbsp;*/</b></li><li>&nbsp;<b class="c256">unbind</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b><b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">stopObserving</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;将对象s的属性扩展进对象d中，如果设置了flag，则不覆盖已存在的属性</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">d</b><b class="c16">,</b>&nbsp;<b class="c256">s</b><b class="c16">,</b>&nbsp;<b class="c256">flag</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">p</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">s</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">flag</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">p</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">d</b><b class="c16">)</b>&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">d</b><b class="c8">[</b><b class="c256">p</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">s</b><b class="c8">[</b><b class="c256">p</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">d</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;clone对象d,&nbsp;如果传入了第二个参数，则对新生成的对象进行扩展</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">clone</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">d</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c256">d</b><b class="c8">.</b><b class="c256">constructor</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">d</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">d</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c8">!</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">d</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b><b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;Function&nbsp;property</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b><b class="c16">(</b><b class="c2">Function</b><b class="c8">.</b><b class="c4">prototype</b><b class="c16">,</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;Function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">bind</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">,</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_t</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;Function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">bindAsEventListener</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">,</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_t</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c8">[</b><b class="c4">event</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">window</b><b class="c8">.</b><b class="c4">event</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">args</b><b class="c16">)</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;String&nbsp;prototype</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b><b class="c16">(</b><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c16">,</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;&nbsp;以camel命名规则格式化字符串&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@example</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'z-index'.camelize();&nbsp;//&nbsp;'zIndex'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'font-size'.camelize();&nbsp;//&nbsp;'fontSize'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">camelize</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">list</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'-'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">pos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">,</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">while</b><b class="c16">(</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">'-'</b><b class="c16">,</b>&nbsp;<b class="c256">pos</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">list</b><b class="c8">[</b><b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">list</b><b class="c8">[</b><b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c4">charAt</b><b class="c16">(</b><b class="c128">0</b><b class="c16">)</b><b class="c8">.</b><b class="c4">toUpperCase</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">list</b><b class="c8">[</b><b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c4">substring</b><b class="c16">(</b><b class="c128">1</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">list</b><b class="c8">.</b><b class="c4">join</b><b class="c16">(</b><b class="c64">''</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;对字符串进行url编码</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">decode</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">decodeURIComponent</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;@description:&nbsp;&nbsp;对字符串进行url解码&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">encode</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">encodeURIComponent</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;@description:&nbsp;&nbsp;按给定的参数顺序格式化字符串</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;'{0}&nbsp;say&nbsp;:&nbsp;{1}&nbsp;get&nbsp;a&nbsp;{2}!'.format('baboo',&nbsp;'benny',&nbsp;'cat');&nbsp;//return&nbsp;'baboo&nbsp;say:&nbsp;benny&nbsp;get&nbsp;a&nbsp;cat!'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">format</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">s</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">;</b>&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c4">arguments</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">s</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">s</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c8">new</b>&nbsp;<b class="c2">RegExp</b><b class="c16">(</b><b class="c64">'\\{'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'\\}'</b><b class="c16">,</b>&nbsp;<b class="c64">'g'</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">s</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;&nbsp;由&nbsp;pro=value&pro1=value1...的字符串解析得到一个Hash对象</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;'name=baboo&sex=male&country=%E4%B8%AD%E5%9B%BD'.getQueryParams();&nbsp;//&nbsp;return&nbsp;{name:'baboo',&nbsp;sex:'male',&nbsp;country:'中国'}</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">getQueryParams</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">paramStrs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^\??/</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'&'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">paramStrs</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">parts</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">paramStrs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'='</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c256">parts</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c256">decode</b><b class="c16">(</b><b class="c16">)</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">parts</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">parts</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c256">decode</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">null</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;判断一个字符串是否由空字符串组成</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">isEmpty</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c8">[</b><b class="c8">\</b><b class="c256">s</b><b class="c8">　</b><b class="c8">]</b><b class="c8">*</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;简单的字符串模板处理,模板变量命名形式为&nbsp;${var_name}</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;'${name}&nbsp;say&nbsp;:&nbsp;${othername}&nbsp;get&nbsp;a&nbsp;${animal}'.process({name:'baboo',&nbsp;othername:'benny',&nbsp;animal:'cat'});&nbsp;//'baboo&nbsp;say:&nbsp;benny&nbsp;get&nbsp;a&nbsp;cat'</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">process</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/\$\{([^\}]+)\}/g</b><b class="c16">,</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">a</b><b class="c16">,</b>&nbsp;<b class="c256">b</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">b</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">b</b><b class="c8">]</b><b class="c16">;</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">a</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;对字符串做正则检测</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">test</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">reg</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">reg</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;去除字符串的前后空白字符</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">trim</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^[\s　]+|[\s　]+$/g</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;String</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;字符串截断，一个半角字符长度为1,&nbsp;全角字符长度为2；截取后缀串的长度算在截取长度内。截取反缀默认为...</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">truncate</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">l</b><b class="c16">,</b>&nbsp;<b class="c256">t</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">l</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">l</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c128">30</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">_t</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/[^\x00-\xff]/g</b><b class="c16">,</b>&nbsp;<b class="c64">'aa'</b><b class="c16">)</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8"><</b><b class="c8">=</b>&nbsp;<b class="c256">l</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">_t</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">t</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b><b class="c16">)</b>&nbsp;<b class="c256">t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'...'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">l</b>&nbsp;<b class="c8">-</b><b class="c8">=</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">,</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">l</b><b class="c16">;</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c256">i</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">_t</b><b class="c8">.</b><b class="c4">charCodeAt</b><b class="c16">(</b><b class="c256">i</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">j</b><b class="c16">)</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c128">0</b><b class="c256">xff</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c256">i</b><b class="c16">;</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c256">j</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">l</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c8">-</b><b class="c8">-</b><b class="c256">j</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">-</b><b class="c8">=</b><b class="c128">2</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;&nbsp;<b class="c256">_t</b><b class="c8">.</b><b class="c4">slice</b><b class="c16">(</b><b class="c128">0</b><b class="c16">,</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">j</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">t</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;Array&nbsp;prototype</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b><b class="c16">(</b><b class="c2">Array</b><b class="c8">.</b><b class="c4">prototype</b><b class="c16">,</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;Array</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">each</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">f</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">try</b><b class="c16">{</b>&nbsp;<b class="c256">f</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">i</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">$continue</b><b class="c16">)</b>&nbsp;<b class="c1">throw</b>&nbsp;<b class="c256">e</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">$break</b><b class="c16">)</b>&nbsp;<b class="c1">throw</b>&nbsp;<b class="c256">e</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;Array</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;返回数组的最后一个元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">last</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c128">1</b><b class="c8">]</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;Array</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;数组中是否包含给定的值</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;boolean</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">include</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@prototype</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;Array</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;查找一个元素在数组中的索引，如果没有找到返回-1</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;number</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">indexOf</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">i</b><b class="c16">;</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@methods</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@name&nbsp;event&nbsp;bind</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;_$实例对象事件绑定方法，事件内型在@see(base,&nbsp;window.$events,&nbsp;$events)定义,</b></li><li><b class="c32">&nbsp;第一个参数为事件处理函数，如果定义了第二个参数的话则为true，则将事件函数的执行上下文绑定在Dom元素对象上</b></li><li><b class="c32">&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;*&nbsp;$('#id').click(function(){</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(this);&nbsp;//firefox&nbsp;this引用Dom元素本身，ie6引用的是window&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;});</b></li><li><b class="c32">&nbsp;$('#id').click(function(){</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(this);&nbsp;//引用Dom元素</b></li><li><b class="c32">&nbsp;},&nbsp;true);</b></li><li><b class="c32">&nbsp;</b></li><li><b class="c32">&nbsp;$('#id').$click(handler);&nbsp;//解除绑定事件</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">events</b><b class="c8">.</b><b class="c256">each</b><b class="c16">(</b><b class="c1">function</b><b class="c16">(</b><b class="c256">v</b><b class="c16">)</b><b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_$</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">[</b><b class="c256">v</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">anony</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observe</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">v</b><b class="c16">,</b>&nbsp;<b class="c256">anony</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">observer</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">observer</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_$</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">[</b><b class="c64">'$'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">v</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">observer</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">elements</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">stopObserving</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">v</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b>&nbsp;</li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c32">/***********************************************************************************************************************************/</b></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;全局的异常处理函数，默认什么也不做，可以按需要重载它</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">doException</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;window作用哉中eval脚本</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">geval</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">s</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c4">window</b><b class="c8">.</b><b class="c256">execScript</b><b class="c16">)</b>&nbsp;<b class="c4">window</b><b class="c8">.</b><b class="c256">execScript</b><b class="c16">(</b><b class="c256">s</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c4">window</b><b class="c8">.</b><b class="c4">eval</b><b class="c16">(</b><b class="c256">s</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">true</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">doException</b><b class="c16">(</b><b class="c64">'$.geval'</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;eval&nbsp;json字符串,&nbsp;异常返回false</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">jeval</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">t</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">eval</b><b class="c16">(</b><b class="c64">'('</b>&nbsp;<b class="c8">+</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">t</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">')'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">doException</b><b class="c16">(</b><b class="c64">'$.jeval'</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;&nbsp;如果传递一个函数，则直接调用它；如果传递进一个字符串，eval它</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">run</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">eval</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isFunction</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;*&nbsp;@description:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dom元素扩展方法，调用途径：&nbsp;通过_$实例对象的$方法调用</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;例：要调用$.Dom._class&nbsp;(e,&nbsp;cn)&nbsp;方法&nbsp;，$(e).$('$class',&nbsp;cn);&nbsp;&nbsp;如果需要返回返回值，则$(e).$('$$class',&nbsp;cn)</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;&nbsp;将自己添加为一个元素的最后一个子元素</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_addTo</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c256">p</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">p</b><b class="c8">.</b><b class="c256">appendChild</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/*</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;@cn:&nbsp;test&nbsp;if&nbsp;contain&nbsp;className&nbsp;cn&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-cn:&nbsp;remove&nbsp;className&nbsp;cn</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;+cn:add&nbsp;className&nbsp;cn</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;cn1=&gt;cn2:&nbsp;replace&nbsp;className&nbsp;cn1&nbsp;to&nbsp;cn2</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_class</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c256">cn</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">cn</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">cn</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^(.+?)\s*=>\s*(.+)$/</b><b class="c16">,</b>&nbsp;<b class="c64">'~$1&nbsp;$2'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ma</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">cn</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c512">/^(\W)?([\w-]+)\s*([\w-]+)?$/</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">ocn</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">className</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c64">''</b><b class="c16">,</b>&nbsp;<b class="c256">reg1</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">RegExp</b><b class="c16">(</b><b class="c64">'(^|\\s+)('</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">')($|\\s+)'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">ma</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">switch</b>&nbsp;<b class="c16">(</b><b class="c256">ma</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'@'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">return</b>&nbsp;&nbsp;<b class="c256">reg1</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">ocn</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'~'</b>&nbsp;&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">className</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ocn</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c256">reg1</b><b class="c16">,</b>&nbsp;<b class="c64">'$1'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">3</b><b class="c8">]</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'$3'</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'-'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">className</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ocn</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c256">reg1</b><b class="c16">,</b>&nbsp;<b class="c64">'$1$3'</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c1">break</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">case</b>&nbsp;<b class="c64">'+'</b>&nbsp;<b class="c8">:</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">default</b><b class="c8">:</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_class</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c64">'@'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">className</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">ocn</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c16">(</b><b class="c256">ocn</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">''</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c64">''</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c64">'&nbsp;'</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">ma</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">true</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_elementsWithClass</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c4">className</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">children</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">getElementsByTagName</b><b class="c16">(</b><b class="c64">'*'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">elements</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c4">children</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">child</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">children</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">child</b><b class="c8">.</b><b class="c4">className</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c8">new</b>&nbsp;<b class="c2">RegExp</b><b class="c16">(</b><b class="c64">"(^|\\s)"</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">className</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">"(\\s|$)"</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">elements</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">child</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">elements</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function&nbsp;&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_hide</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">display</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'none'</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;返回元素在页面中的坐标</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_position</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">x</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">y</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">,</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">oriDisplay</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">display</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">display</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">''</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">while</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">x</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">offsetLeft</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">y</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">offsetTop</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">offsetParent</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">o</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">display</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">oriDisplay</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">[</b><b class="c4">x</b><b class="c16">,</b>&nbsp;<b class="c4">y</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;将元素从父元素中移除</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_remove</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">parentNode</b><b class="c8">.</b><b class="c256">removeChild</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c16">}</b><b class="c16">,</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;移除元素的所有子节点,&nbsp;e.innerHTML&nbsp;=&nbsp;''&nbsp;的Dom&nbsp;API实现</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_empty</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">children</b>&nbsp;<b class="c8">=</b>&nbsp;&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c256">childNodes</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c4">children</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">removeChild</b><b class="c16">(</b><b class="c4">children</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">firstChild</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">removeChild</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c256">firstChild</b>&nbsp;<b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;设置元素的display样式为可见</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_show</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">display</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">''</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;设置或获取元素的样式，根据传入的第2个参数决定执行动作，如果第2个参数是一个字符串，则进行样式获取，如果是一个对象，则进行样式设置</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对象的格式为：{stylename1:&nbsp;stylevalue1,&nbsp;stylename2:stylevalue2}</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@example:</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//获取样式</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.Dom._style(e,&nbsp;'color');</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//设置样式</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.Dom._style(e,&nbsp;{color:'red'});</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_style</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c4">style</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/*&nbsp;get&nbsp;style&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c4">style</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">value</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">style</b><b class="c8">[</b><b class="c4">style</b><b class="c8">.</b><b class="c256">camelize</b><b class="c16">(</b><b class="c16">)</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c4">value</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">document</b><b class="c8">.</b><b class="c256">defaultView</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">defaultView</b><b class="c8">.</b><b class="c256">getComputedStyle</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">css</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">defaultView</b><b class="c8">.</b><b class="c256">getComputedStyle</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c1">null</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">value</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">css</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">css</b><b class="c8">.</b><b class="c256">getPropertyValue</b><b class="c16">(</b><b class="c4">style</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c256">currentStyle</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">value</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">currentStyle</b><b class="c8">[</b><b class="c4">style</b><b class="c8">.</b><b class="c256">camelize</b><b class="c16">(</b><b class="c16">)</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">window</b><b class="c8">.</b><b class="c256">opera</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">[</b><b class="c64">'left'</b><b class="c16">,</b>&nbsp;<b class="c64">'top'</b><b class="c16">,</b>&nbsp;<b class="c64">'right'</b><b class="c16">,</b>&nbsp;<b class="c64">'bottom'</b><b class="c8">]</b><b class="c8">.</b><b class="c256">include</b><b class="c16">(</b><b class="c4">style</b><b class="c16">)</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">_style</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c64">'position'</b><b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'static'</b><b class="c16">)</b>&nbsp;<b class="c4">value</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'auto'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">value</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'auto'</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c1">null</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c4">value</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/*set&nbsp;style*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">style</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">with</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isFunction</b><b class="c16">(</b><b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">style</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">.</b><b class="c256">camelize</b><b class="c16">(</b><b class="c16">)</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">doException</b><b class="c16">(</b><b class="c64">'$.Dom._style'</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;设置元素的透明度,&nbsp;0~1之间</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_opacity</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c4">value</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isIE</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">filter</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'alpha(opacity='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">round</b><b class="c16">(</b><b class="c4">value</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">100</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">')'</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">opacity</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">value</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;元素的显示/隐藏切换</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_toggle</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">[</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">style</b><b class="c8">.</b><b class="c256">display</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'none'</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c64">'_show'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c64">'_hide'</b>&nbsp;<b class="c8">]</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">;</b><b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;元素e在所有子节点的未尾添加子元素c</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_append</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c1">if</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">appendChild</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">c</b><b class="c16">)</b><b class="c16">;</b><b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;在元素e的第一个子节点前添加元素c</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_prepend</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c1">if</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isElement</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">insertBefore</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">c</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">firstChild</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;在元素e前添加元素c</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_before</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c256">e</b><b class="c8">.</b><b class="c256">parentNode</b><b class="c8">.</b><b class="c256">insertBefore</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">c</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b><b class="c16">;</b><b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Dom</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;在元素e后添加元素c</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_after</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">e</b><b class="c16">,</b>&nbsp;<b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c256">e</b><b class="c8">.</b><b class="c256">parentNode</b><b class="c8">.</b><b class="c256">insertBefore</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c256">c</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">c</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">nextSibling</b><b class="c16">)</b><b class="c16">;</b><b class="c16">}</b>&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">bind</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pro</b><b class="c16">,</b>&nbsp;<b class="c256">isOverload</b><b class="c16">,</b>&nbsp;<b class="c256">hasRet</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c16">(</b><b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">_$</b><b class="c8">.</b><b class="c4">prototype</b><b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c256">isOverload</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_$</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">arguments</b><b class="c16">,</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">[</b><b class="c64">'_'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">undefined</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">undefined</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">hasRet</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">extend</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c256">isOverload</b><b class="c16">,</b>&nbsp;<b class="c256">bindSets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">pro</b><b class="c8">.</b><b class="c4">charAt</b><b class="c16">(</b><b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c64">'_'</b><b class="c16">)</b>&nbsp;<b class="c256">pro</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'_'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">pro</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b>&nbsp;<b class="c16">(</b><b class="c256">pro</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c256">isOverload</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">pro</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isArray</b><b class="c16">(</b><b class="c256">bindSets</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c256">pro</b><b class="c16">,</b>&nbsp;<b class="c256">bindSets</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">bindSets</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@methods</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;_$</b></li><li><b class="c32">&nbsp;*&nbsp;@name&nbsp;quickCallDomMethod</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;_$实例对象提供对第一个元素Dom操作的简便入口</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">[</b><b class="c64">'empty'</b><b class="c16">,</b>&nbsp;<b class="c64">'hide'</b><b class="c16">,</b>&nbsp;<b class="c64">'show'</b><b class="c16">,</b>&nbsp;<b class="c64">'remove'</b><b class="c16">,</b>&nbsp;<b class="c64">'toggle'</b><b class="c16">,</b>&nbsp;<b class="c64">'opacity'</b><b class="c16">,</b>&nbsp;<b class="c64">'addTo'</b><b class="c16">,</b>&nbsp;<b class="c64">'append'</b><b class="c16">,</b>&nbsp;<b class="c64">'prepend'</b><b class="c16">,</b>&nbsp;<b class="c64">'before'</b><b class="c16">,</b>&nbsp;<b class="c64">'after'</b><b class="c8">]</b><b class="c8">.</b><b class="c256">each</b><b class="c16">(</b><b class="c1">function</b><b class="c16">(</b><b class="c256">pro</b><b class="c16">)</b><b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Dom</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c256">pro</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c32">/***********************************END&nbsp;Dom*********************************************************/</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@class&nbsp;$.Cookie</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Cookie</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">document</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">days</b><b class="c16">,</b>&nbsp;<b class="c256">path</b><b class="c16">,</b>&nbsp;<b class="c4">domain</b><b class="c16">,</b>&nbsp;<b class="c256">secure</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$document</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$name</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">name</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$days</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">days</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$path</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">path</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$domain</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">domain</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$secure</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">secure</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;$.Cookie&nbsp;prototypes</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Cookie</b><b class="c8">.</b><b class="c4">prototype</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Cookie</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">load</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">cookieval</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Cookie</b><b class="c8">.</b><b class="c256">All</b><b class="c8">.</b><b class="c4">get</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">$document</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$name</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">cookieval</b><b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">a</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">cookieval</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b>&nbsp;<b class="c64">'&'</b>&nbsp;<b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b><b class="c16">(</b>&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">a</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c256">a</b><b class="c8">[</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">a</b><b class="c8">[</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b>&nbsp;<b class="c64">':'</b>&nbsp;<b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b><b class="c16">(</b>&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">a</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c1">this</b><b class="c8">[</b>&nbsp;<b class="c256">a</b><b class="c8">[</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">]</b><b class="c8">[</b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c8">]</b>&nbsp;<b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">a</b><b class="c8">[</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">]</b><b class="c8">[</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">]</b><b class="c8">.</b><b class="c256">decode</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Cookie</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">remove</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Cookie</b><b class="c8">.</b><b class="c256">All</b><b class="c8">.</b><b class="c256">remove</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">$document</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$name</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$path</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$domain</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@method</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Cookie</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">store</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">cookieval</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">""</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">prop</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c1">this</b><b class="c16">)</b><b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c16">(</b>&nbsp;<b class="c256">prop</b><b class="c8">.</b><b class="c4">charAt</b><b class="c16">(</b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'$'</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c16">(</b><b class="c16">(</b>&nbsp;<b class="c4">typeof</b>&nbsp;<b class="c1">this</b><b class="c8">[</b>&nbsp;<b class="c256">prop</b>&nbsp;<b class="c8">]</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'function'</b>&nbsp;<b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b>&nbsp;<b class="c256">cookieval</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c64">""</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c256">cookieval</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">'&'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">cookieval</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c256">prop</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">':'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c256">prop</b><b class="c8">]</b><b class="c8">.</b><b class="c256">encode</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Cookie</b><b class="c8">.</b><b class="c256">All</b><b class="c8">.</b><b class="c256">set</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">$document</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$name</b><b class="c16">,</b>&nbsp;<b class="c256">cookieval</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$days</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$path</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$domain</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">$secure</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Cookie.All</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Cookie</b><b class="c8">.</b><b class="c256">All</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Cookie.All</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">get</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">d</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">allcookies</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">d</b><b class="c8">.</b><b class="c4">cookie</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/\s/g</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b>&nbsp;<b class="c256">allcookies</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">""</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">start</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">allcookies</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c4">name</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'='</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">start</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c1">null</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">continue</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">start</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c4">name</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">end</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">allcookies</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">';'</b><b class="c16">,</b>&nbsp;<b class="c256">start</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">end</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c256">end</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">allcookies</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">allcookies</b><b class="c8">.</b><b class="c4">substring</b><b class="c16">(</b><b class="c256">start</b><b class="c16">,</b>&nbsp;<b class="c256">end</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">ret</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Cookie.All</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">set</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">d</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c4">value</b><b class="c16">,</b>&nbsp;<b class="c256">days</b><b class="c16">,</b>&nbsp;<b class="c256">path</b><b class="c16">,</b>&nbsp;<b class="c4">domain</b><b class="c16">,</b>&nbsp;<b class="c256">secure</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">value</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">expiration</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">days</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Date</b><b class="c16">(</b><b class="c16">(</b><b class="c8">new</b>&nbsp;<b class="c2">Date</b><b class="c16">(</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">.</b>&nbsp;<b class="c4">getTime</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">days</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">24</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">3600000</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">expiration</b><b class="c16">)</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';&nbsp;expires='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">expiration</b><b class="c8">.</b><b class="c4">toGMTString</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">path</b><b class="c16">)</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';&nbsp;path='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">path</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">domain</b><b class="c16">)</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';domain='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">domain</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">secure</b><b class="c16">)</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';secure'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">d</b><b class="c8">.</b><b class="c4">cookie</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">cookie</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Cookie.All</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">remove</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">d</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">path</b><b class="c16">,</b>&nbsp;<b class="c4">domain</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'='</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b>&nbsp;<b class="c256">path</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';&nbsp;path='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">path</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b>&nbsp;<b class="c4">domain</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';&nbsp;domain='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">domain</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">cookie</b>&nbsp;<b class="c8">+</b><b class="c8">=</b>&nbsp;<b class="c64">';&nbsp;expires=Fri,&nbsp;02-Jan-1970&nbsp;00:00:00&nbsp;GMT'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">d</b><b class="c8">.</b><b class="c4">cookie</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">cookie</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c32">/***********************************END&nbsp;Cookie*******************************************************/</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Builder</b></li><li><b class="c32">&nbsp;*&nbsp;@namespace&nbsp;$</b></li><li><b class="c32">&nbsp;*&nbsp;@description&nbsp;元素生成对象</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Builder</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">NODEMAP</b><b class="c8">:</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">AREA</b><b class="c8">:</b>&nbsp;<b class="c64">'map'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">CAPTION</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">COL</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">COLGROUP</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">LEGEND</b><b class="c8">:</b>&nbsp;<b class="c64">'fieldset'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">OPTGROUP</b><b class="c8">:</b>&nbsp;<b class="c64">'select'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">OPTION</b><b class="c8">:</b>&nbsp;<b class="c64">'select'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">PARAM</b><b class="c8">:</b>&nbsp;<b class="c64">'object'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">TBODY</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">TD</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">TFOOT</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">TH</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">THEAD</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">TR</b><b class="c8">:</b>&nbsp;<b class="c64">'table'</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Builder</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">node</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">html</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c8">/</b><b class="c8">^</b><b class="c8"><</b><b class="c8">[</b><b class="c8">^</b><b class="c8">></b><b class="c8">]</b><b class="c8">+</b><b class="c8">?</b><b class="c8">\</b><b class="c8">/</b><b class="c8">?</b><b class="c8">></b><b class="c16">(</b><b class="c16">(</b><b class="c8">.</b><b class="c8">|</b><b class="c8">\</b><b class="c256">n</b><b class="c16">)</b><b class="c8">*</b><b class="c8"><</b><b class="c8">\</b><b class="c8">/</b><b class="c8">[</b><b class="c8">^</b><b class="c8">></b><b class="c8">]</b><b class="c8">+</b><b class="c8">></b><b class="c16">)</b><b class="c8">?</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c256">html</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">tagName</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">html</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c512">/<(\w+)(?:\s|>)/</b><b class="c16">)</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c4">toUpperCase</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">parentTag</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">NODEMAP</b><b class="c8">[</b><b class="c4">tagName</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c64">'DIV'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">parentElement</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">createElement</b><b class="c16">(</b><b class="c256">parentTag</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">parentElement</b><b class="c8">.</b><b class="c4">innerHTML</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">html</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">element</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">parentElement</b><b class="c8">.</b><b class="c256">firstChild</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c4">element</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c4">element</b><b class="c8">.</b><b class="c4">tagName</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c4">tagName</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">getElementsByTagName</b><b class="c16">(</b><b class="c4">tagName</b><b class="c16">)</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c8">!</b><b class="c4">element</b><b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">arguments</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">addChildren</b><b class="c16">(</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">element</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">addChildren</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">children</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">cs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c4">children</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">cs</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isStringOrNumber</b><b class="c16">(</b><b class="c256">cs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">appendChild</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c4">text</b><b class="c16">(</b><b class="c256">cs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">appendChild</b><b class="c16">(</b><b class="c256">cs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Builder</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">text</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">str</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">createTextNode</b><b class="c16">(</b><b class="c256">str</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c32">/***********************************END&nbsp;Node&nbsp;Builder*************************************************/</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Ajax</b></li><li><b class="c32">&nbsp;*/</b></li><li>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">defaultSets</b><b class="c8">:</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">method</b><b class="c8">:</b>&nbsp;<b class="c64">'post'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">asyn</b><b class="c8">:</b>&nbsp;<b class="c1">true</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">querying</b><b class="c8">:</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">cache</b><b class="c8">:</b>&nbsp;<b class="c16">{</b><b class="c16">}</b></li><li>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;</li><li>&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@Object&nbsp;$.Ajax.Base</b></li><li><b class="c32">&nbsp;&nbsp;*/</b></li><li>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">Base</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">getHeader</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">name</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">http</b><b class="c8">.</b><b class="c256">getResponseHeader</b><b class="c16">(</b><b class="c4">name</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">doException</b><b class="c16">(</b><b class="c64">'$.Ajax.getHeader'</b><b class="c16">,</b>&nbsp;<b class="c256">e</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">getHttp</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">trys</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c64">'new&nbsp;XMLHttpRequest()'</b><b class="c16">,</b>&nbsp;<b class="c64">'new&nbsp;ActiveXObject("Msxml2.XMLHTTP")'</b><b class="c16">,</b>&nbsp;<b class="c64">'new&nbsp;ActiveXObject("Microsoft.XMLHTTP")'</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">trys</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">eval</b><b class="c16">(</b><b class="c256">trys</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@class&nbsp;$.Ajax.Simple</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">Simple</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b><b class="c16">(</b><b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">__init</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">sets</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">clone</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">defaultSets</b><b class="c16">,</b>&nbsp;&nbsp;<b class="c256">sets</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">http</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">getHttp</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c1">this</b><b class="c8">.</b><b class="c256">http</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">_run</b><b class="c16">(</b><b class="c256">url</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_run</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">url</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c8">[</b><b class="c64">'get'</b><b class="c16">,</b>&nbsp;<b class="c64">'post'</b><b class="c8">]</b><b class="c8">.</b><b class="c256">include</b><b class="c16">(</b><b class="c256">t</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">.</b><b class="c4">method</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">.</b><b class="c4">method</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'post'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">http</b><b class="c8">.</b><b class="c4">open</b><b class="c16">(</b><b class="c256">t</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">.</b><b class="c4">method</b><b class="c16">,</b>&nbsp;<b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">asyn</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">http</b><b class="c8">.</b><b class="c256">onreadystatechange</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">onStateChange</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c256">t</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">http</b><b class="c8">.</b><b class="c256">send</b><b class="c16">(</b><b class="c256">t</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">.</b><b class="c4">method</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'post'</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c16">(</b><b class="c256">t</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">postBody</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c64">"_"</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">null</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">onStateChange</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">http</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">http</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">http</b><b class="c8">.</b><b class="c4">readyState</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">4</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">http</b><b class="c8">.</b><b class="c4">status</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">200</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">[</b><b class="c64">'onSuccess'</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b><b class="c16">(</b><b class="c256">http</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">getHeader</b><b class="c16">(</b><b class="c64">'X-JSON'</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">sets</b><b class="c8">[</b><b class="c64">'onFailure'</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b><b class="c16">(</b><b class="c256">http</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">,</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">Base</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@class&nbsp;$.Json</b></li><li><b class="c32">&nbsp;*&nbsp;@description:&nbsp;用于与服务器进行JSON数据交互，运用于数据驱动应用及解决Ajax跨域问题</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Json</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c16">(</b><b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">__init</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c256">callback</b><b class="c16">,</b>&nbsp;<b class="c256">cacheIt</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">cacheId</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">cacheIt</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isString</b><b class="c16">(</b><b class="c256">cacheIt</b><b class="c16">)</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">cacheIt</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">url</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c64">''</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">cacheIt</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">cache</b><b class="c8">[</b><b class="c256">cacheId</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">callback</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">cache</b><b class="c8">[</b><b class="c256">cacheId</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">gid</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">gid</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">url</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">url</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c16">(</b><b class="c256">url</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">'?'</b><b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c64">'?'</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c64">'&'</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'callback='</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">gid</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">window</b><b class="c8">[</b><b class="c256">gid</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">json</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">cacheIt</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">cache</b><b class="c8">[</b><b class="c256">cacheId</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">json</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">callback</b><b class="c16">(</b><b class="c256">json</b><b class="c16">)</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">window</b><b class="c8">[</b><b class="c256">gid</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">undefined</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">delete</b>&nbsp;<b class="c4">window</b><b class="c8">[</b><b class="c256">gid</b><b class="c8">]</b>&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c16">}</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">head</b><b class="c16">)</b>&nbsp;<b class="c4">setTimeout</b><b class="c16">(</b><b class="c1">function</b><b class="c16">(</b><b class="c16">)</b><b class="c16">{</b><b class="c256">head</b><b class="c8">.</b><b class="c256">removeChild</b><b class="c16">(</b><b class="c256">script</b><b class="c16">)</b><b class="c16">}</b><b class="c16">,</b>&nbsp;<b class="c128">10</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">head</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">getElementsByTagName</b><b class="c16">(</b><b class="c64">'head'</b><b class="c16">)</b>&nbsp;<b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">script</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">createElement</b><b class="c16">(</b><b class="c64">'script'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">script</b><b class="c8">.</b><b class="c4">src</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">url</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">head</b><b class="c8">.</b><b class="c256">appendChild</b><b class="c16">(</b><b class="c256">script</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@description:&nbsp;具有缓存性质的Ajax数据请求</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">dataQuery</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c256">sets</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">cacheID</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">cacheID</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">url</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">cacheID</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">cache</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">[</b><b class="c64">'callback'</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">cache</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">querying</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b><b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">querying</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">true</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">new</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">Simple</b><b class="c16">(</b><b class="c256">url</b><b class="c16">,</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">method</b><b class="c8">:</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c4">method</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c64">'get'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">onSuccess</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">t</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">data</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">sets</b><b class="c8">[</b><b class="c64">'process'</b><b class="c8">]</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">sets</b><b class="c8">[</b><b class="c64">'process'</b><b class="c8">]</b><b class="c16">(</b><b class="c256">t</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c256">responseText</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">noCache</b><b class="c16">)</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">cache</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">data</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">querying</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">[</b><b class="c64">'callback'</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">)</b><b class="c16">(</b><b class="c4">data</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b>&nbsp;<b class="c256">onFailure</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">delete</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Ajax</b><b class="c8">.</b><b class="c256">querying</b><b class="c8">[</b><b class="c256">cacheID</b><b class="c8">]</b><b class="c16">;</b><b class="c16">(</b><b class="c256">sets</b><b class="c8">[</b><b class="c64">'onerror'</b><b class="c8">]</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c32">/***********************************END&nbsp;Ajax*********************************************************/</b></li><li></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Event</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description:&nbsp;属性导出配制，参见：@see(base,&nbsp;window.$export,&nbsp;$export);</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">EXPORT</b><b class="c8">:</b>&nbsp;<b class="c8">[</b><b class="c64">'observe'</b><b class="c16">,</b>&nbsp;<b class="c64">'stopObserving'</b><b class="c16">,</b>&nbsp;<b class="c64">'Keys'</b><b class="c8">]</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">Keys</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c16">{</b><b class="c256">BACKSPACE</b><b class="c8">:</b>&nbsp;<b class="c128">8</b><b class="c16">,</b>&nbsp;<b class="c256">TAB</b><b class="c8">:</b>&nbsp;<b class="c128">9</b><b class="c16">,</b>&nbsp;<b class="c256">RETURN</b><b class="c8">:</b>&nbsp;<b class="c128">13</b><b class="c16">,</b>&nbsp;<b class="c256">ESC</b><b class="c8">:</b>&nbsp;<b class="c128">27</b><b class="c16">,</b>&nbsp;<b class="c256">LEFT</b><b class="c8">:</b>&nbsp;<b class="c128">37</b><b class="c16">,</b>&nbsp;<b class="c256">UP</b><b class="c8">:</b>&nbsp;<b class="c128">38</b><b class="c16">,</b>&nbsp;<b class="c256">RIGHT</b><b class="c8">:</b>&nbsp;<b class="c128">39</b><b class="c16">,</b><b class="c256">DOWN</b><b class="c8">:</b>&nbsp;<b class="c128">40</b><b class="c16">,</b>&nbsp;<b class="c256">DELETE</b><b class="c8">:</b>&nbsp;<b class="c128">46</b><b class="c16">,</b>&nbsp;<b class="c256">HOME</b><b class="c8">:</b>&nbsp;<b class="c128">36</b><b class="c16">,</b>&nbsp;<b class="c256">END</b><b class="c8">:</b>&nbsp;<b class="c128">35</b><b class="c16">,</b>&nbsp;<b class="c256">PAGEUP</b><b class="c8">:</b>&nbsp;<b class="c128">33</b><b class="c16">,</b>&nbsp;<b class="c256">PAGEDOWN</b><b class="c8">:</b>&nbsp;<b class="c128">34</b><b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">observers</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_observeAndCache</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">element</b><b class="c8">.</b><b class="c256">addEventListener</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c8">[</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">addEventListener</b><b class="c16">(</b><b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">element</b><b class="c8">.</b><b class="c256">attachEvent</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c8">[</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">attachEvent</b><b class="c16">(</b><b class="c64">'on'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">observe</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">useCapture</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">useCapture</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">name</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'keypress'</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c4">navigator</b><b class="c8">.</b><b class="c4">appVersion</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c512">/Konqueror|Safari|KHTML/</b><b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">attachEvent</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'keydown'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">_observeAndCache</b><b class="c16">(</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">[</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">stopObserving</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">null</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">obs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">arguments</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">oriObs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c16">,</b>&nbsp;<b class="c256">newObs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">item</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">oriObs</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">item</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">oriObs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">item</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">element</b><b class="c16">)</b>&nbsp;<b class="c256">obs</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">item</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c256">newObs</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">item</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b>&nbsp;&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">newObs</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">obs</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c8">[</b><b class="c4">element</b><b class="c16">,</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c1">false</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">obs</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">item</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">obs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c4">element</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">item</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">item</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">item</b><b class="c8">[</b><b class="c128">2</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">item</b><b class="c8">[</b><b class="c128">3</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">name</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'keypress'</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c16">(</b><b class="c4">navigator</b><b class="c8">.</b><b class="c4">appVersion</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b><b class="c512">/Konqueror|Safari|KHTML/</b><b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">detachEvent</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">name</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'keydown'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">element</b><b class="c8">.</b><b class="c256">removeEventListener</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">removeEventListener</b><b class="c16">(</b><b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">,</b>&nbsp;<b class="c256">useCapture</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">element</b><b class="c8">.</b><b class="c256">detachEvent</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">.</b><b class="c256">detachEvent</b><b class="c16">(</b><b class="c64">'on'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c4">name</b><b class="c16">,</b>&nbsp;<b class="c256">observer</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">unloadCache</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c1">null</b><b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b><b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">stopObserving</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c1">this</b><b class="c16">,</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observers</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">null</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">Methods</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">element</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">target</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">srcElement</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">find</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">event</b><b class="c16">,</b>&nbsp;<b class="c4">tagName</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">target</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">srcElement</b><b class="c16">;</b>&nbsp;<b class="c4">tagName</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">tagName</b><b class="c8">.</b><b class="c4">toUpperCase</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c1">while</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c4">tagName</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c4">tagName</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">tagName</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c64">'HTML'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c256">parentNode</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">e</b><b class="c8">.</b><b class="c4">tagName</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c4">tagName</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">e</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">false</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">x</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">pageX</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c16">(</b><b class="c4">event</b><b class="c8">.</b><b class="c4">clientX</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c16">(</b><b class="c4">document</b><b class="c8">.</b><b class="c256">documentElement</b><b class="c8">.</b><b class="c256">scrollLeft</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">body</b><b class="c8">.</b><b class="c256">scrollLeft</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">y</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">pageY</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c16">(</b><b class="c4">event</b><b class="c8">.</b><b class="c4">clientY</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c16">(</b><b class="c4">document</b><b class="c8">.</b><b class="c256">documentElement</b><b class="c8">.</b><b class="c256">scrollTop</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">body</b><b class="c8">.</b><b class="c256">scrollTop</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">keyCode</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">keyCode</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">event</b><b class="c8">.</b><b class="c4">which</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Event.Methods</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">stop</b><b class="c8">:</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">evt</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">event</b><b class="c16">;</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">evt</b><b class="c8">.</b><b class="c256">preventDefault</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">evt</b><b class="c8">.</b><b class="c256">preventDefault</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c256">evt</b><b class="c8">.</b><b class="c256">stopPropagation</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">evt</b><b class="c8">.</b><b class="c4">returnValue</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b>&nbsp;<b class="c256">evt</b><b class="c8">.</b><b class="c4">cancelBubble</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">true</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">observe</b><b class="c16">(</b><b class="c4">window</b><b class="c16">,</b>&nbsp;<b class="c64">'unload'</b><b class="c16">,</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c2">Event</b><b class="c8">.</b><b class="c256">unloadCache</b><b class="c16">,</b>&nbsp;<b class="c1">false</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Browser</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description&nbsp;:&nbsp;属性导出设置，参见:&nbsp;@see(base,&nbsp;window.$export,&nbsp;$export);</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">EXPORT</b><b class="c8">:</b>&nbsp;<b class="c8">[</b><b class="c64">'Gecko=&gt;isGecko'</b><b class="c16">,</b>&nbsp;<b class="c64">'IE=&gt;isIE'</b><b class="c16">,</b>&nbsp;<b class="c64">'Opera=&gt;isOpera'</b><b class="c16">,</b>&nbsp;<b class="c64">'WebKit=&gt;isWebKit'</b><b class="c16">,</b>&nbsp;<b class="c64">'Version=&gt;BrowserVersion'</b><b class="c8">]</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;boolean</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description&nbsp;&nbsp;&nbsp;&nbsp;浏览器内核是否是Gecko引擎的(例：firefox浏览器)</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">Gecko</b><b class="c8">:</b>&nbsp;&nbsp;<b class="c4">navigator</b><b class="c8">.</b><b class="c4">userAgent</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">'Gecko'</b><b class="c16">)</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c8">-</b><b class="c128">1</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c4">navigator</b><b class="c8">.</b><b class="c4">userAgent</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">'KHTML'</b><b class="c16">)</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b>&nbsp;<b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;boolean</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description&nbsp;&nbsp;&nbsp;&nbsp;浏览器内核是否是IE引擎的</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">IE</b><b class="c8">:</b>&nbsp;<b class="c8">/</b><b class="c256">msie</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c4">navigator</b><b class="c8">.</b><b class="c4">userAgent</b><b class="c8">.</b><b class="c4">toLowerCase</b><b class="c16">(</b><b class="c16">)</b><b class="c16">)</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;boolean</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description&nbsp;&nbsp;&nbsp;&nbsp;浏览器是否是Opera</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">Opera</b><b class="c8">:</b>&nbsp;<b class="c8">!</b><b class="c8">!</b><b class="c4">window</b><b class="c8">.</b><b class="c256">opera</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;boolean</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description&nbsp;&nbsp;&nbsp;&nbsp;浏览器是否使用的是WebKit引擎(Safari,Midori等)</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">WebKit</b><b class="c8">:</b>&nbsp;<b class="c4">navigator</b><b class="c8">.</b><b class="c4">userAgent</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">'AppleWebKit/'</b><b class="c16">)</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var&nbsp;Number</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Browser</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@description&nbsp;&nbsp;&nbsp;&nbsp;浏览器版本</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">Version</b><b class="c8">:</b>&nbsp;<b class="c16">(</b><b class="c4">navigator</b><b class="c8">.</b><b class="c4">userAgent</b><b class="c8">.</b><b class="c4">match</b><b class="c16">(</b>&nbsp;<b class="c512">/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">)</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Timer</b></li><li><b class="c32">&nbsp;*&nbsp;@description:</b></li><li><b class="c32">&nbsp;*&nbsp;Timer&nbsp;&nbsp;&nbsp;</b></li><li><b class="c32">&nbsp;*&nbsp;!&nbsp;You&nbsp;should&nbsp;not&nbsp;put&nbsp;a&nbsp;complex&nbsp;computer&nbsp;in&nbsp;this&nbsp;timer.</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Timer</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">defaultSets</b><b class="c8">:</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">timespan</b><b class="c8">:</b>&nbsp;<b class="c128">2</b><b class="c16">,</b>&nbsp;<b class="c256">callback</b><b class="c8">:</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Timer</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">add</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c16">)</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">extend</b><b class="c16">(</b><b class="c256">sets</b><b class="c16">,</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">defaultSets</b><b class="c16">,</b>&nbsp;<b class="c1">true</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">callPos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Date</b><b class="c16">(</b><b class="c16">)</b><b class="c8">.</b><b class="c4">getTime</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">timespan</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">1000</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">sets</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c1">this</b><b class="c8">.</b><b class="c256">timer</b><b class="c16">)</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">timer</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c4">setInterval</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">loop</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c128">40</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">sets</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Timer</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">remove</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">nqueen</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c256">nqueen</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">nqueen</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">clearInterval</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">timer</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">timer</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">loop</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">now</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Date</b><b class="c16">(</b><b class="c16">)</b><b class="c8">.</b><b class="c4">getTime</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">sets</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">queen</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">callPos</b>&nbsp;<b class="c8"><</b><b class="c8">=</b>&nbsp;<b class="c256">now</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c64">'callback'</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">run</b><b class="c16">(</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">callback</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c8">.</b><b class="c256">loop</b><b class="c16">)</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">callPos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">now</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">sets</b><b class="c8">.</b><b class="c256">timespan</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">1000</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">remove</b><b class="c16">(</b><b class="c256">sets</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@Object&nbsp;$.Effect</b></li><li><b class="c32">&nbsp;*/</b></li><li>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Effect</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effects</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">add</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">effect</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">timestamp</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Date</b><b class="c16">(</b><b class="c16">)</b><b class="c8">.</b><b class="c4">getTime</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">startOn</b>&nbsp;&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">delay</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">1000</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">timestamp</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">finishOn</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">startOn</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">duration</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">1000</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">currentFrame</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">totalFrames</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">fps</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">duration</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c4">status</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'idle'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c256">effect</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c8">!</b><b class="c1">this</b><b class="c8">.</b><b class="c256">interval</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">interval</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Timer</b><b class="c8">.</b><b class="c256">add</b><b class="c16">(</b><b class="c16">{</b><b class="c256">timespan</b><b class="c8">:</b>&nbsp;<b class="c128">0</b><b class="c8">.</b><b class="c128">04</b><b class="c16">,</b>&nbsp;<b class="c256">loop</b><b class="c8">:</b><b class="c1">true</b><b class="c16">,</b>&nbsp;<b class="c256">callback</b><b class="c8">:</b><b class="c1">this</b><b class="c8">.</b><b class="c256">loop</b><b class="c8">.</b><b class="c256">bind</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">remove</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">effect</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">efs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">[</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">effect</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">efs</b><b class="c8">.</b><b class="c4">push</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">else</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c256">render</b><b class="c16">(</b><b class="c128">1</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">effect</b><b class="c8">.</b><b class="c4">status</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'finish'</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c256">effect</b><b class="c8">.</b><b class="c256">onFinish</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b>&nbsp;<b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">efs</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Timer</b><b class="c8">.</b><b class="c256">remove</b><b class="c16">(</b><b class="c1">this</b><b class="c8">.</b><b class="c256">interval</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">interval</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">false</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">loop</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">timePos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">new</b>&nbsp;<b class="c2">Date</b><b class="c16">(</b><b class="c16">)</b><b class="c8">.</b><b class="c4">getTime</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ef</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">effects</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">timePos</b>&nbsp;<b class="c8">></b><b class="c8">=</b>&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">finishOn</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">render</b><b class="c16">(</b><b class="c128">1</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c4">status</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'finish'</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">//(ef.onFinish&nbsp;||&nbsp;$.empty)&nbsp;();</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c256">remove</b><b class="c16">(</b><b class="c256">ef</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b>&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">ef</b><b class="c8">.</b><b class="c4">status</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c64">'idle'</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c256">ef</b><b class="c8">.</b><b class="c256">onStart</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">empty</b><b class="c16">)</b>&nbsp;<b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c4">status</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'running'</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">pos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">(</b><b class="c256">timePos</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">startOn</b><b class="c16">)</b>&nbsp;<b class="c8">/</b>&nbsp;<b class="c16">(</b><b class="c256">ef</b><b class="c8">.</b><b class="c256">finishOn</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">startOn</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">frame</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">round</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">totalFrames</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">frame</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">currentFrame</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">render</b><b class="c16">(</b><b class="c256">ef</b><b class="c8">.</b><b class="c256">transition</b><b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ef</b><b class="c8">.</b><b class="c256">currentFrame</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">frame</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;</li><li>&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@Object&nbsp;$.Effect.Transtions</b></li><li><b class="c32">&nbsp;&nbsp;*/</b></li><li>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Effect</b><b class="c8">.</b><b class="c256">Transitions</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@var</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@descriptioni:&nbsp;属性导出设置，参见:&nbsp;@see(base,&nbsp;window.$export,&nbsp;$export);</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">EXPORT</b><b class="c8">:</b>&nbsp;<b class="c64">'all'</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">linear</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">pos</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">sinoidal</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c16">(</b><b class="c8">-</b><b class="c2">Math</b><b class="c8">.</b><b class="c4">cos</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">PI</b><b class="c16">)</b>&nbsp;<b class="c8">/</b>&nbsp;<b class="c128">2</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">0</b><b class="c8">.</b><b class="c128">5</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">reverse</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">pos</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">flicker</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c16">(</b><b class="c16">(</b><b class="c8">-</b><b class="c2">Math</b><b class="c8">.</b><b class="c4">cos</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">PI</b><b class="c16">)</b>&nbsp;<b class="c8">/</b>&nbsp;<b class="c128">4</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">0</b><b class="c8">.</b><b class="c128">75</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">random</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">/</b>&nbsp;<b class="c128">4</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">wobble</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c16">(</b><b class="c8">-</b><b class="c2">Math</b><b class="c8">.</b><b class="c4">cos</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">PI</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c16">(</b><b class="c128">9</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c256">pos</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">/</b>&nbsp;<b class="c128">2</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">0</b><b class="c8">.</b><b class="c128">5</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@namespace&nbsp;$.Effect.Transitions</b></li><li><b class="c32">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">pulse</b><b class="c8">:</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c16">(</b><b class="c2">Math</b><b class="c8">.</b><b class="c4">floor</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">10</b><b class="c16">)</b>&nbsp;<b class="c8">%</b>&nbsp;<b class="c128">2</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c8">?</b>&nbsp;&nbsp;<b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">10</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">floor</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">10</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c128">1</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">10</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c2">Math</b><b class="c8">.</b><b class="c4">floor</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">*</b>&nbsp;<b class="c128">10</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;@var&nbsp;Object</b></li><li><b class="c32">&nbsp;&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">Effect</b><b class="c8">.</b><b class="c256">DefaultSets</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">transition</b><b class="c8">:</b>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">Effect</b><b class="c8">.</b><b class="c256">Transitions</b><b class="c8">.</b><b class="c256">sinoidal</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">duration</b><b class="c8">:</b>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c128">1</b><b class="c8">.</b><b class="c128">0</b><b class="c16">,</b>&nbsp;&nbsp;&nbsp;<b class="c32">//&nbsp;seconds</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">fps</b><b class="c8">:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c128">25</b><b class="c8">.</b><b class="c128">0</b><b class="c16">,</b>&nbsp;&nbsp;<b class="c32">//&nbsp;max.&nbsp;25fps&nbsp;due&nbsp;to&nbsp;Effect.Queue&nbsp;implementation</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">from</b><b class="c8">:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c128">0</b><b class="c8">.</b><b class="c128">0</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">to</b><b class="c8">:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c128">1</b><b class="c8">.</b><b class="c128">0</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">delay</b><b class="c8">:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c128">0</b><b class="c8">.</b><b class="c128">0</b></li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;*&nbsp;@function</b></li><li><b class="c32">&nbsp;*/</b></li><li><b class="c8">$</b><b class="c8">.</b><b class="c256">effect</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">sets</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">clone</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">Effect</b><b class="c8">.</b><b class="c256">DefaultSets</b><b class="c16">,</b>&nbsp;<b class="c256">sets</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li><b class="c16">}</b><b class="c16">;</b></li><li></li><li><b class="c256">$export</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li></li><li><b class="c32">/**</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;&nbsp;bind&nbsp;document&nbsp;ready</b></li><li><b class="c32">&nbsp;&nbsp;*&nbsp;&nbsp;url&nbsp;:&nbsp;http://webreflection.blogspot.com/search?q=onContent</b></li><li><b class="c32">&nbsp;&nbsp;*/</b></li><li><b class="c16">(</b><b class="c1">function</b><b class="c16">(</b><b class="c16">)</b><b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">callback</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isReady</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c8">!</b><b class="c8">$</b><b class="c8">.</b><b class="c256">ReadyList</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c1">return</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isIE</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c256">documentElement</b><b class="c8">.</b><b class="c256">doScroll</b><b class="c16">(</b><b class="c64">"left"</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b><b class="c16">(</b>&nbsp;<b class="c256">error</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">setTimeout</b><b class="c16">(</b>&nbsp;<b class="c4">arguments</b><b class="c8">.</b><b class="c4">callee</b><b class="c16">,</b>&nbsp;<b class="c128">0</b>&nbsp;<b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">isReady</b>&nbsp;&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">true</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">ReadyList</b><b class="c8">.</b><b class="c256">each</b><b class="c16">(</b><b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">f</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">f</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">delete</b>&nbsp;<b class="c8">$</b><b class="c8">.</b><b class="c256">ReadyList</b>&nbsp;<b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">__onload__</b><b class="c8">=</b><b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">E</b><b class="c8">:</b><b class="c1">function</b><b class="c16">(</b><b class="c16">)</b><b class="c16">{</b><b class="c4">window</b><b class="c8">.</b><b class="c4">onload</b><b class="c8">=</b><b class="c1">null</b><b class="c16">;</b><b class="c256">callback</b><b class="c16">(</b><b class="c16">)</b><b class="c16">}</b><b class="c16">,</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">IES</b><b class="c8">:</b><b class="c1">function</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b><b class="c16">{</b><b class="c1">if</b><b class="c16">(</b><b class="c256">e</b><b class="c8">.</b><b class="c4">readyState</b><b class="c8">=</b><b class="c8">=</b><b class="c8">=</b><b class="c64">"complete"</b><b class="c16">)</b><b class="c1">this</b><b class="c8">.</b><b class="c4">E</b><b class="c16">(</b><b class="c16">)</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">onload</b><b class="c8">=</b><b class="c256">callback</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isWebKit</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isOpera</b>&nbsp;<b class="c8">&</b><b class="c8">&</b>&nbsp;<b class="c4">parseInt</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">BrowserVersion</b><b class="c16">)</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c128">9</b><b class="c16">)</b><b class="c16">)</b>&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">(</b><b class="c1">function</b><b class="c16">(</b><b class="c16">)</b><b class="c16">{</b><b class="c8">/</b><b class="c256">loaded</b><b class="c8">|</b><b class="c4">complete</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c4">document</b><b class="c8">.</b><b class="c4">readyState</b><b class="c16">)</b><b class="c8">?</b><b class="c256">__onload__</b><b class="c8">.</b><b class="c4">E</b><b class="c16">(</b><b class="c16">)</b><b class="c8">:</b><b class="c4">setTimeout</b><b class="c16">(</b><b class="c4">arguments</b><b class="c8">.</b><b class="c4">callee</b><b class="c16">,</b><b class="c128">1</b><b class="c16">)</b><b class="c16">}</b><b class="c16">)</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c4">document</b><b class="c8">.</b><b class="c256">addEventListener</b><b class="c16">)</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">document</b>&nbsp;<b class="c8">.</b><b class="c256">addEventListener</b>&nbsp;<b class="c16">(</b><b class="c64">'DOMContentLoaded'</b><b class="c16">,</b>&nbsp;<b class="c256">__onload__</b>&nbsp;<b class="c8">.</b><b class="c4">E</b><b class="c16">,</b>&nbsp;<b class="c1">false</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">else</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c8">!</b><b class="c8">$</b><b class="c8">.</b><b class="c256">isOpera</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">parseInt</b><b class="c16">(</b><b class="c8">$</b><b class="c8">.</b><b class="c256">BrowserVersion</b><b class="c16">)</b>&nbsp;<b class="c8">></b><b class="c8">=</b>&nbsp;<b class="c128">9</b><b class="c16">)</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c4">document</b><b class="c8">.</b><b class="c4">write</b><b class="c16">(</b><b class="c64">'&lt;SCR'</b><b class="c8">+</b><b class="c64">'IPT&nbsp;onreadystatechange="__onload__.IES(this)"&nbsp;src="javascript:void(0)"&nbsp;defer="defer"&gt;&lt;/SCR'</b><b class="c8">+</b><b class="c64">'IPT&gt;'</b><b class="c16">)</b><b class="c16">;</b></li><li><b class="c16">}</b><b class="c16">)</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li></li></ol></div>
</body>
</html>
